#include "widget.h"
#include "ui_form.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    this->setWindowTitle(QString("选关界面"));
    over =new gameover;
    over->hide();
    connect(over,SIGNAL(replay()),this,SLOT(again()));
    connect(over,SIGNAL(gg()),this,SLOT(gg()));
}

Widget::~Widget()
{
    delete ui;
}

void Widget::on_pushButton_clicked()
{them.init_map(0);
    game=new MainWindow;
        connect(game,SIGNAL(gameover()),this,SLOT(HQ()));
    this->hide();game->show();qDebug("第一关");
}

void Widget::on_pushButton_2_clicked()
{
    them.init_map(1);game=new MainWindow;
        connect(game,SIGNAL(gameover()),this,SLOT(HQ()));
    this->hide();game->show();
}

void Widget::on_pushButton_3_clicked()
{
    them.init_map(2);game=new MainWindow;
        connect(game,SIGNAL(gameover()),this,SLOT(HQ()));
    this->hide();game->show();
}

void Widget::on_pushButton_4_clicked()
{them.init_map(3);game=new MainWindow;
        connect(game,SIGNAL(gameover()),this,SLOT(HQ()));
    this->hide();game->show();
}


void Widget::on_pushButton_5_clicked()
{
    them.init_map(2);this->hide();chosen=new choose;chosen->show();
    connect(chosen,SIGNAL(start()),this,SLOT(play()));
}
void Widget::play()
{
    game=new MainWindow;this->hide();game->show();
     connect(game,SIGNAL(gameover()),this,SLOT(HQ()));
}
